﻿CREATE proc phannhommenu_xoamenu
@ID as int
as
declare @MaNhom int
declare @MenuID int
select @MaNhom=MaNhomMenuND,@MenuID=MenuID from QuanTri_PhanNhomMenu Where ID=@ID
if(exists(select * from QuanTri_PhanNhomMenu Where MaNhomMenuND=@MaNhom and MenuCha=@MenuID))
begin
select ErrCode=0
end
else
begin
delete from QuanTri_PhanNhomMenu where ID=@ID
select ErrCode=1
end